package cn.tedu._04mvcboot01.controller;
import cn.tedu._04mvcboot01.pojo.dto.BmoDTO2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

public class BmiController2 {
    @RequestMapping("v1/user/bmi")
    @ResponseBody
    public String bmi(BmoDTO2 bmoDTO2){
        double height= bmoDTO2.getHeight();
        double weight= bmoDTO2.getWeight();
        double bmi=weight/(height*height);
        if (bmi<18.5){
            return "兄弟你瘦了";
        }
        if (bmi<24){
            return "你非常健康";
        }
        if (bmi<27){
            return "微胖";
        }
        return "该减肥了";
    }
}
